home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap06 / PropDemo / PropDemo.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.9 KB  |  101 lines

  1. //***********************************************************************
  2. //
  3. //  PropDemo.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CMyApp : public CWinApp
  8. {
  9. public:
  10.     virtual BOOL InitInstance ();
  11. };
  12.  
  13. class CBkgndPage : public CPropertyPage
  14. {
  15. public:
  16.     int m_nFillType;
  17.     int m_nFillColor;
  18.  
  19.     CBkgndPage () : CPropertyPage (IDD_BKGNDPAGE) {}
  20.  
  21. protected:
  22.     virtual void DoDataExchange (CDataExchange*);
  23.  
  24.     afx_msg void OnChange (UINT);
  25.     DECLARE_MESSAGE_MAP ()
  26. };
  27.  
  28. class CTextPage : public CPropertyPage
  29. {
  30. public:
  31.     CString m_text;
  32.     int m_nHeight;
  33.     BOOL m_bBold;
  34.     BOOL m_bItalic;
  35.  
  36.     CTextPage () : CPropertyPage (IDD_TEXTPAGE) {}
  37.  
  38. protected:
  39.     virtual void DoDataExchange (CDataExchange*);
  40.  
  41.     afx_msg void OnChange ();
  42.     DECLARE_MESSAGE_MAP ()
  43. };
  44.  
  45. class CMyPropertySheet : public CPropertySheet
  46. {
  47. public:
  48.     CBkgndPage m_bkgndPage;
  49.     CTextPage m_textPage;
  50.  
  51.     CMyPropertySheet (CWnd* = NULL);
  52.  
  53. protected:
  54.     afx_msg void OnApplyNow ();
  55.     DECLARE_MESSAGE_MAP ()
  56. };
  57.  
  58. class CMainWindow : public CFrameWnd
  59. {
  60. private:
  61.     int m_nFillType;
  62.     int m_nFillColor;
  63.     CString m_text;
  64.     int m_nHeight;
  65.     BOOL m_bBold;
  66.     BOOL m_bItalic;
  67.  
  68.     void DoSolidFill (CDC*, CRect*);
  69.     void DoGradientFill (CDC*, CRect*);
  70.     void DoDrawText (CDC*, CRect*);
  71.  
  72. public:
  73.     CMainWindow ();
  74.     void ApplyNow (CMyPropertySheet*);
  75.  
  76. protected:
  77.     afx_msg BOOL OnEraseBkgnd (CDC*);
  78.     afx_msg void OnPaint ();
  79.     afx_msg void OnOptionsProperties ();
  80.     afx_msg void OnOptionsExit ();
  81.     afx_msg void OnOptionsAbout ();
  82.  
  83.     DECLARE_MESSAGE_MAP ()
  84. };
  85.  
  86. class CAboutDialog : public CDialog
  87. {
  88. private:
  89.     CRect m_rect;
  90.  
  91. public:
  92.     CAboutDialog (CWnd* pParentWnd = NULL) :
  93.         CDialog (IDD_ABOUTDLG, pParentWnd) {}
  94.  
  95.     virtual BOOL OnInitDialog ();
  96.  
  97. protected:
  98.     afx_msg void OnPaint ();
  99.     DECLARE_MESSAGE_MAP ()
  100. };
  101.